// org/x/casemodule/dto/ScheduleSyncRequest.java
package org.x.casemodule.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.x.casemodule.enums.PlatformEnum;
import org.x.casemodule.enums.SyncDirectionEnum;

import java.util.Date;
import java.util.List;

@Data
public class ScheduleSyncRequest {
    @NotNull(message = "平台类型不能为空")
    private PlatformEnum platform;

    @NotEmpty(message = "认证令牌不能为空")
    private String authToken;

    @NotNull(message = "同步方向不能为空")
    private SyncDirectionEnum syncDirection;

    private String calendarId = "primary"; // 默认为primary

    private SyncFilters syncFilters;

    @Data
    public static class SyncFilters {
        private List<String> eventTypes; // 事件类型过滤
        private DateRange dateRange;     // 日期范围过滤

        @Data
        public static class DateRange {
            @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
            private Date start;

            @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
            private Date end;
        }
    }
}
